Conversation
The Freebuff build stripped the `[prompt...]` positional that codebuff accepts, so `freebuff "say hi"` failed with "invalid for argument 'command'". Every tool that opens a coding agent in a terminal with the task already typed in (orchestrators, tmux launchers, editor and IDE actions, scripts) could drive codebuff, claude, codex, opencode, kilo and copilot this way but not Freebuff. Accept `[prompt...]` in the Freebuff branch of the parser. `login` stays the only command and is recognised only as the first word, so a prompt that begins with a codebuff command word (`publish ...`) remains a prompt. The text flows through the existing initialPrompt -> useChatInput -> message queue -> chat admission path, so the session, landing screen and ad surfaces behave exactly as when the user types. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HgZQgjCVwHjmWGErkMdAUu
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Let the
freebuffCLI accept an initial prompt as a positional argument, the waycodebuffalready does:loginstays the one command. Any other first word is the start of the prompt, sofreebuff publish the release notesis a prompt, not the codebuffpublishcommand (which Freebuff does not expose).Why
Today the Freebuff build strips the
[prompt...]argument, sofreebuff "say hi"fails with:That is the one thing that keeps Freebuff out of every tool that opens a coding agent in a terminal with a task already typed in: multi-agent orchestrators, tmux/zellij launchers, editor and IDE "open agent with this prompt" actions, shell aliases, scripts that start a TUI session. All of those already drive
claude,codex,opencode,kilo,copilot,gooseandcodebuffthis way; Freebuff is the only one they have to launch empty, so it is the one they leave out of their agent picker. See #947 for the longer story.How it keeps ads and sessions intact
Nothing about the run path changes. The prompt goes through the same
initialPromptprop anduseChatInputeffect codebuff uses, which callsonSubmitPrompt->routeUserPrompt-> the message queue. With no live session the queue holds the text anduseFreebuffChatAdmissionstarts the session with the saved model exactly as if the user had typed it on the landing screen. The landing screen, the ad dock, inline ads, Freebucks confirmation, country/rate-limit notices and the takeover prompt all render as before; this only pre-fills what the user would have typed. Every ad impression happens in the Freebuff TUI, same as today.This is deliberately not a headless mode. A
--print/ NDJSON mode (the other half of #947) needs an answer for where ads go, and that is a product decision for the Freebuff team; this PR is the part that has no such question.Changes
cli/src/cli-args.ts: Freebuff branch accepts[prompt...];loginis detected as a command only when it is the first word; theArgumentimport is gone. The help text gains aCommands:footer matching codebuff's.cli/src/__tests__/cli-args.test.ts: new Freebuff cases (joined prompt, prompt with--cwdand--continue, command-word prompt).loginstill parses as a command with no prompt.README.md: one quick-start example.Verification
cd cli && bun test src/__tests__/cli-args.test.ts: 20 pass (17 before).freebuff -hnow printsUsage: freebuff [options] [prompt...]with theCommands: loginfooter.bun run typecheckincli/reports the same 18 pre-existingsdk/src/impl/llm.tsprovider-options errors onmainand on this branch; none in the touched files.cli/bunfig.tomlpreloads../test/setup-scm-loader.ts, which is not in the export, sobun testcannot start without a local shim (related to cli: restore the .scm preload socd cli && bun teststarts #1363).🤖 Generated with Claude Code
https://claude.ai/code/session_01HgZQgjCVwHjmWGErkMdAUu